<div id="menu_top">
	<%= link_to "Wiki", :controller => "page", :action => "index" %> | 
	<%= link_to "Project", :controller => "project", :action => "list" %> |
	<%= link_to "CRM", :controller => "crm", :action => "index" %> | 
	<%= link_to "Customer", :controller => "customer/overview", :action => "index" %>
</div>
<span style="font: bold 50px areal;margin-bottom: 20px;display: block;">
	<%= link_to "Wiki", :controller => "page", :action => "view", :id => 1 %>
</span>
<% if flash[:notice] %>
	<div id="flash"><%= flash[:notice] %></div>
<% end %>
<%= start_form_tag :action => 'update', :id => @page %>
	<%= text_field 'page', 'search', 'size' => 22, 'value' => "Search", :id => "search"  %>
	<%= submit_tag 'Go', :class => "submit" %>
<%= end_form_tag %>
<div class="menu">
	<% if @session[:user_id] == nil %>
		User: <%= link_to "New ", { :controller => "user", :action => "add_user" } %> | 
		<%= link_to "Lost Password", { :controller => "user", :action => "lost_pass" } %> | 
		<%= link_to "Login", { :controller => "user", :action => "login" } %>
	<% else %>
		User: <%= link_to "Settings", { :controller => "user", :action => "settings" } %> | 
		<%= link_to "Logout (#{@session[:nickname]})", { :controller => "user", :action => "logout" } %>
	<% end %>

</div>
<div class="menu">
	Wiki: 
	<% if @session[:user_id] != nil  %>
		<%= link_to "New Page", { :controller => "page", :action => "new" } %> |
    <% end %>
	<%= link_to "Last Events", { :controller => "events", :action => "last" } %>
</div>

<% if @session[:user_id] != nil %>
<div class="menu_head">Private Pages</div>
<div class="tree_container">
	
	<% @pagePrivate.each do |t| %>
		<div><%= link_to t.title, :controller => "page", :action => "view", :id => t.id %></div>
	<% end %>
	
	<% if @pagePrivate.empty? %>
		<div>No Private Pages</div>
	<% end %>
</div>
<% end %>

<div class="menu_head">
<% if @session[:user_id] %>
Public
<% end %> Pages</div>
<div class="tree_container">
	<% @pagePublic.each do |t| %>
		<div><%= link_to t.title, :controller => "page", :action => "view", :id => t.id %></div>
	<% end %>
	
	<% if @pagePublic.empty? %>
		<div>No Public Pages</div>
	<% end %>
</div>